<template>
	<view class="container">
		<top-back-navbar position="fixed" title="钱包" background="#224f91" color="#ffff"></top-back-navbar>
		<view class="header">
			<view class="header-box" @click="$u.route('/pages/member/info/info')">
				<image :src="res.avatar || '/static/33.jpg'" class="face"></image>
				<view class="right_header_box">
					<view class="user-name">{{res.nickname || '游客'}}</view>
					<view class="user-id">ID号：{{res.yqm ||''}}</view>
					<!-- <view class="user-levelname">{{res.ishaveagent}}</view> -->
				</view>
			</view>
		</view>
		<view class="qianbao-title">资产数据</view>
		<view class="qianbao-list">
			<view class="qianbao-list-item">
				<view class="qianbao-item" style="width: 100%;">
					<view class="qianbao-item-list" @click="$u.route(`/pages/member/acommsion/projcommision/details`)">
						<view class="qianbao-name">我的收益</view>
						<view class="qianbao-icon qianbao-icon-border">进入</view>
					</view>
					<view class="qianbao-item-list" @click="$u.route('/pages/member/details/tx/txc')">
						<view class="qianbao-money">{{res.credit1 || '0.00'}}</view>
						<view class="qianbao-icon qianbao-icon-bg">提现</view>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="qianbao-list">
			<view class="qianbao-list-item">
				<view class="qianbao-item">
					<view class="qianbao-item-list" @click="$u.route(`/pages/member/acommsion/projcommision/details?type=2`)">
						<view class="qianbao-name">我的收益</view>
						<view class="qianbao-icon qianbao-icon-border">进入</view>
					</view>
					<view class="qianbao-item-list" @click="$u.route('/pages/member/details/tx/txc?type=2')">
						<view class="qianbao-money">{{res.credit1 || '0.00'}}</view>
						<view class="qianbao-icon qianbao-icon-bg">提现</view>
					</view>
				</view>
				<view class="qianbao-item qianbao-border" @click="$u.route(`/pagesD/mine_detailed/mine_detailed?type=equity`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">权益券</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.equity || '0.00'}}</view>
						<view class="qianbao-icon"></view>
					</view>
				</view>
			</view>
		</view>
		<view class="qianbao-list">
			<view class="qianbao-list-item">
				<view class="qianbao-item" @click="$u.route(`/pagesD/mine_detailed/mine_detailed?type=education`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">教育金</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.lecturer_fund || '0.00'}}</view>
						<view class="qianbao-icon"></view>
					</view>
				</view>
				<view class="qianbao-item qianbao-border" @click="$u.route(`/pagesD/punchclock/punchclock`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">每日打卡</view>
						<view class="qianbao-icon qianbao-icon-bg">打卡</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.day_card || '0'}}</view>
						<view class="qianbao-money">{{res.sign_bucket || '0'}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="qianbao-list">
			<view class="qianbao-list-item">
				<view class="qianbao-item" @click="$u.route(`/pagesD/mine_detailed/mine_detailed?type=welfare`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">福利金</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.welfare_fund || '0.00'}}</view>
						<view class="qianbao-icon"></view>
					</view>
				</view>
				<view class="qianbao-item qianbao-border" @click="$u.route(`/pagesD/mine_detailed/mine_detailed?type=public_welfare`)">
					<view class="qianbao-item-list">
						<view class="qianbao-name">公益金</view>
						<view class="qianbao-icon qianbao-icon-border">明细</view>
					</view>
					<view class="qianbao-item-list">
						<view class="qianbao-money">{{res.public_welfare_fund || '0.00'}}</view>
						<view class="qianbao-icon"></view>
					</view>
				</view>
			</view>
		</view> -->

		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tzz: '0',
				credit2: '0',
				bz: '0',
				a_kzp: '0',
				credit1: '0',
				nickname: '游客',
				avatar: '../../static/33.jpg',
				res: [],
				is_realname: '',
				active: "active",
				openid: '',
				data: [],
			};
		},
		computed: {
			//状态栏高度
			statusHeight() {
				return uni.getSystemInfoSync().statusBarHeight || 10; //如果没有获取到高度，那么指定10px；
			}
		},
		onLoad: function() {
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			});
		},
		onNavigationBarButtonTap: function(e) {
			uni.navigateTo({
				url: 'info/info'
			});
		},
		methods: {
			setAjax() {
				uni.request({
					url: this.$BASE_URL+'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member&app=1&type=gf',
					method: 'POST',
					data: {
						'openid': this.openid
					},
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					success: res => {
						// console.log(res)
						uni.hideLoading()
						this.res = res.data
						this.is_realname = res.data.is_realname
						var order = this.order
						for (var i in order) {
							this.order[i].badge = res.data.order[i]
						}
					},
					fail: () => {},
					complete: () => {}
				});
			},
			jumpno() {
				uni.showModal({
					title: '提示',
					content: '功能即将开放',
					showCancel: false,
					confirmColor: "#DD524D",
					success() {
						return
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f3f6fb;
		height: 100%;
	}

	.container {
		;
		height: 100%;
	}

	.header {
		padding: 30rpx;

		.header-box {
			display: flex;
			background: #224f91;
			padding:30rpx;
			border-radius: 30rpx;
			overflow: hidden;
			.face {
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
				background-color: #fff;
			}

			.right_header_box {
				flex: 1;
				padding-left: 30rpx;
				.user-name {
					font-size: 32rpx;
					font-weight: bold;
					color: #fff;
				}

				.user-levelname {
					font-size: 28rpx;
					color: #fff;
					padding: 10rpx 0;
				}

				.user-id {
					font-size: 28rpx;
					color: #fff;
				}
			}

		}
	}

	.qianbao-title {
		padding: 30rpx 30rpx 0 30rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #000;
	}

	.qianbao-list {
		padding: 30rpx 30rpx 0 30rpx;

		.qianbao-list-item {
			padding: 30rpx 20rpx;
			display: flex;
			align-items: center;
			border-radius:20rpx;
			box-shadow: 0px 2px 8px 3px rgba(235,235,235,0.4);
			background-color: #fff;
			.qianbao-item-list{
				display: flex;
				align-items: center;
				justify-content: space-between;
				height: 70rpx;
			}
			.qianbao-item {
				width: 50%;
				position: relative;
				padding:0 20rpx;
				.qianbao-name {
					font-size: 28rpx;
					color: #888;
				}

				.qianbao-money {
					font-size: 32rpx;
					font-weight: bold;
					min-height: 32rpx;
				}

				.qianbao-icon {
					font-size: 24rpx;
					padding: 0 20rpx;
					height: 46rpx;
					border-radius: 20rpx;
				}
				.qianbao-icon-border{
					border:1px solid #888;
					color:#888;
				}
				.qianbao-icon-bg{
					border:1px solid #d52d22;
					background-color: #d52d22;
					color:#fff;
				}
			}

			.qianbao-border {
				border-left: 1px solid #eee;
			}
		}
	}
</style>
